package com.toby.demo.service.impl;

import com.toby.demo.service.PropagationService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class PropagationServiceImpl implements PropagationService {

    @Transactional
    @Override
    public void required() {
        throw new NullPointerException("肥朝假装抛出了异常");
    }

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    @Override
    public void requiresNew() {
        throw new NullPointerException("肥朝假装抛出了异常");
    }
}
